﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreData;
using Services;
using Helper;
using System.Data;
namespace ActionServices
{

    public interface IClassActionService:BaseActionService
    {
        long Save(object _model, ref string mess);
        IList<CoreData.Class> GetListByLINQ(Func<CoreData.Class, Boolean> _where);
        CoreData.Class GetOneByLINQ(Func<CoreData.Class, Boolean> _where);
        bool Delete(object _model);
        IList<CoreData.Class> GetByCourseID(long courseID);
        bool UpdateIsDelete(object _model);
        IList<CoreData.Class> GetByTeacherID(long TeacherID);
        CoreData.Class GetByCode(string Code);
        IList<Class> GetByBranchID(long BranchID);
        string GenCodeClass(string code);
        /// <summary>
        /// Lấy báo cáo danh sách các lớp chưa tốt nghiệp
        /// </summary>
        /// <param name="SearchString"></param>
        /// <returns></returns>
        DataTable GetReportClassNotDone(string SearchString);
    }

    public partial class ClassActionService:IClassActionService
    {
       ClassService Service;

       public ClassActionService()
       {
           Service = new ClassService();
       }

       #region Main Method

       public virtual long Save(object _model, ref string mess)
       {
           return Service.Save(_model, ref mess);
       }

       public virtual object GetByID(long _id)
       {
           return Service.GetByID(_id);
       }

       public virtual object GetList()
       {
           return Service.GetList();
       }

       public virtual IList<CoreData.Class> GetListByLINQ(Func<CoreData.Class, Boolean> _where)
       {
           return Service.GetListByLINQ(_where);
       }

       public virtual CoreData.Class GetOneByLINQ(Func<CoreData.Class, Boolean> _where)
       {
           return Service.GetOneByLINQ(_where);
       }

       public virtual object GetList(string _searchstring)
       {
           return Service.GetList(_searchstring);
       }

       public virtual bool Delete(object _model)
       {
           return Service.Delete(_model);
       }

       public virtual bool UpdateIsDelete(object _model)
       {
           return Service.UpdateIsDelete(_model);
       }

       #endregion


        #region Other Method

       public virtual IList<CoreData.Class> GetByCourseID(long courseID)
       {
           return Service.GetByCourseID(courseID);
       }

       public virtual IList<CoreData.Class> GetByTeacherID(long TeacherID)
       {
           return Service.GetByTeacherID(TeacherID);
       }

       public virtual CoreData.Class GetByCode(string Code)
       {
           return Service.GetByCode(Code);
       }

        public virtual IList<Class> GetByBranchID(long BranchID)
       {
           return Service.GetByBranchID(BranchID);
       }
        public virtual string GenCodeClass(string code)
        {
            return Service.GenCodeClass(code);
      }
        public virtual DataTable  GetReportClassNotDone(string SearchString)
        {
            return Service.GetReportClassNotDone(SearchString);
        }
        #endregion

    }
         
}
